package com.zhkj.txg.module.order.entity

import com.google.gson.annotations.SerializedName
import com.zhkj.lib.http.BaseResponse
import java.io.Serializable

data class OrderSubmitDetailResponse(
    val data: OrderSubmitDetailEntity? = null
) : BaseResponse()

data class OrderSubmitGroupResponse(
    val data: OrderSubmitGroupEntity? = null
) : BaseResponse()

data class OrderSubmitGroupEntity(
    @SerializedName("share_id")
    val shareId: Int = 0,
    val groups: MutableList<String> = mutableListOf(),
    @SerializedName("total_fee")
    val goodsTotalFee: Double = 0.0,
    @SerializedName("total_num")
    val goodsTotalNum: Int = 0,
    @SerializedName("coupon_list")
    val couponList: MutableList<OrderCouponEntity> = mutableListOf(),
    val goods: OrderGoodsEntity? = null,
    var address: OrderAddressEntity? = null
)

data class OrderSubmitDetailEntity(
    @SerializedName("share_id")
    val shareId: Int = 0,
    @SerializedName("goods_total_num")
    val goodsTotalNum: Int = 0,
    @SerializedName("goods_total_fee")
    val goodsTotalFee: Double = 0.0,
    @SerializedName("coupon_list")
    val couponList: MutableList<OrderCouponEntity> = mutableListOf(),
    @SerializedName("cart_list")
    val cartList: MutableList<CartEntity> = mutableListOf(),
    var address: OrderAddressEntity? = null,
    var selectCoupon: OrderCouponEntity? = null,
    val discount: String = "",
    @SerializedName("delivery_money")
    val deliveryMoney: String = ""
) {
    // 使用优惠券之后的总价
    var useCouponTotalPrice: Double = 0.0
}

data class CartEntity(
    @SerializedName("shop_id")
    val shopId: Int,
    @SerializedName("shop_name")
    val shopName: String = "",
    @SerializedName("shop_img")
    val shopImg: String = "",
    @SerializedName("is_delivery")
    val isDelivery: Int,
    @SerializedName("active_type")
    val activeType: Int,
    @SerializedName("is_free_shipping")
    val isFreeFreight: Boolean = true,
    @SerializedName("shop_shipping_fee")
    val freight: Double = 0.0,
    @SerializedName("shop_total_num")
    val shopTotalNum: Int = 0,
    @SerializedName("shop_total_fee")
    val shopTotalFee: Double = 0.0,
    @SerializedName("shop_cut_fee")
    val cutPrice: String? = null,
    @SerializedName("goods_list")
    var goodsList: MutableList<OrderGoodsEntity> = mutableListOf(),
    @SerializedName("coupon_list")
    val couponList: MutableList<OrderCouponEntity> = mutableListOf(),
    var selectCoupon: OrderCouponEntity? = null,
    var orderDesc: String? = ""
) {
    // 使用优惠券之后的店铺总价
    var useCouponTotalPrice: Double = 0.0
}

data class OrderGoodsEntity(
    @SerializedName("cart_id")
    val cartId: String = "",
    @SerializedName("item_id")
    val itemId: String = "",
    @SerializedName("member_goods_price", alternate = ["goods_price"])
    val goodsPrice: Double = 0.0,
    val market_price: Double = 0.0,
    @SerializedName("is_free_shipping")
    val isFreeFreight: Boolean = true,
    @SerializedName("shipping_fee")
    val freight: Double = 0.0,
    @SerializedName("spec_key_name")
    val specName: String = "",
    val image: String = "",
    @SerializedName("goods_id")
    val goodsId: Int,
    @SerializedName("goods_name")
    val goodsName: String,
    var selectCoupon: OrderCouponEntity? = null,
    @SerializedName("goods_num")
    val goodsNumber: Int,
    @SerializedName("share_earn")
    val shareEarn: String? = null
) {
    // 使用优惠券之后的总价
    var useCouponTotalPrice: Double = 0.0
}

//{"id":174,"start_time":"2020-09-21","end_time":"2020-09-30","use_type":"2","money":"5.00","condition":"10.00","name":"面包券","user_type_text":"类别券"}
data class OrderCouponEntity(
    @SerializedName("id")
    val id: Int,
    val name: String = "",
    val money: Double = 0.0,
    val condition: Double = 0.0,
    @SerializedName("type_text")
    val typeText: String = "",
    @SerializedName("use_type_text")
    val areaTypeText: String = "",
    @SerializedName("start_time")
    val startTime: String = "",
    @SerializedName("end_time")
    val endTime: String = "",
    @SerializedName("use_type_long_text")
    val descText: String? = null,
    @SerializedName("use_type")
    val useType: String = ""
) {
    var shown: Boolean = false
}

data class OrderAddressEntity(
    val id: Int,
    val consignee: String,
    val mobile: String,
    @SerializedName("full_address")
    val address: String,
    @SerializedName("is_default")
    val isDefault: Boolean = false
) : Serializable